package com.qfjy.controller;

import com.qfjy.entity.po.Role;
import com.qfjy.service.RoleService;
import com.qfjy.util.resulst.ResultCode;
import com.qfjy.util.resulst.ResultJson;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName RoleController
 * @Description TODO
 * @Author guoweixin
 * @Date 2023/5/25
 * @Version 1.0
 */
@Controller
@RequestMapping("role")
@Slf4j
@Api(tags = {"角色模块"})
public class RoleController {

    @Autowired
   private RoleService roleService;

    @GetMapping("list")
    @ResponseBody
    @ApiOperation(value ="查询所有的角色信息")
    public ResultJson list(){

        List<Role> list=roleService.selectList();

        return new ResultJson(list, ResultCode.SUCCESS);
    }
}
